package com.xxdemo.quickstart;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.text.StringEscapeUtils;

public class SqlInjectionCheckingTool {
    static String safeTokenFromUnsafe(String unsafeNameSearchToken) {
        if (StringUtils.isEmpty(unsafeNameSearchToken)) {
            return "";
        }
        String trimmedToken = unsafeNameSearchToken.replaceAll("%", "").trim();
        return StringEscapeUtils.escapeHtml4(trimmedToken);
    }
}
